<template>
	<view class="contain">
		<u--textarea v-model.trim="content" placeholder="请输入需要嘱托的内容" count  focus></u--textarea>
		<u-button @click="submit">提交</u-button>
	</view>
</template>

<script>
	import {parentEntrustSave} from '@/api/entrust.js'
	export default {
			data() {
				return {
					content: '',
				}
			},
			methods:{
				async submit(){
					const {data}=await parentEntrustSave({
						parentId:this.$util.getUser().userId,
						parentName:this.$util.getUser().username,
						content:this.content,
						classId:this.$util.getChild().classId,
						className:this.$util.getChild().className
					})
					console.log('ddddddd',data)
					if(data.code==0){
						this.$api.showTip('嘱托成功',()=>{
							uni.navigateBack({
								delta: 1
							});
						})
					}
				}
			}
		}
</script>

<style lang="scss" scoped>
	.contain{
		padding: 20rpx;
		/deep/.u-textarea__field{
			height: 300rpx!important;
		}
		/deep/.u-button{
			width: 200rpx;
			background-color: $uni-theme-color;
			color: #fff;
			margin-top: 50rpx;
		}
	}
</style>